<?php

if(isset($_POST['submit']))
	
{
	
	$username = $_POST['username'];
	$pword = $_POST['pw'];
	$height = $_POST['height'];
	$weight = $_POST['weight'];
	$age = $_POST['age'];
	$gender = $_POST['gender'];
	$activity = $_POST['activity'];
	
	if ($username != "" && $pword != "" && $height != "" && $weight != "" && $age != "" && $gender != "")
	{
// 		$pword = md5($pword);
		require_once 'dbOper.php';
		insertUser($username, $pword, $height, $weight, $age, $gender, $activity);
	}
	
}

?>

<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>

<body>
<div id=main>
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">
<div>Username: </div><input class="1" type="text" name="username" placeholder="Username..."><br/>
<div>Password: </div><input class="1" type="password" name="pw"><br/>
<div>Height: </div><input class="1" type="text" name="height" placeholder="Your height in centimeters"><br/>
<div>Weight: </div><input class="1" type="text" name="weight" placeholder="Your weight in kilograms"><br/>
<div>Age: </div><input class="1" type="text" name="age" placeholder="Your age"><br/>
<div>Gender:  </div>
<select class="1" name="gender">
<option>Male</option>
<option>Female</option>
</select><br/>
<div>Activity level: </div>

<select class="1" name="activity">
<option value="1.4">Sedentary (daily mundane activities)</option>
<option value="1.7">Moderately active (taking walks in the park) </option>
<option value="2">Vigorously active (sports, weightlifting etc)</option>
<option value="2.4">Extremely active (competetive sports, athlete)</option>
</select><br/>
<input class="1" type="submit" value="submit" name="submit">
</form>
</div>
</body>

</html>